package com.joizhang.seckill.utils;

import com.joizhang.seckill.api.service.exception.CodeMsg;

public class WebCodeMsg extends CodeMsg {

    public static CodeMsg SUCCESS = new CodeMsg(200_000, "success");
    public static CodeMsg SECKILL_SUCCESS = new CodeMsg(200_001, "秒杀成功");

    /**
     * 通用的错误码
     */
    public static CodeMsg SERVER_ERROR = new CodeMsg(500_100, "服务端异常");
    public static CodeMsg BIND_ERROR = new CodeMsg(500_101, "参数校验异常：%s");
    public static CodeMsg ACCESS_LIMIT_REACHED = new CodeMsg(500_104, "访问高峰期，请稍等！");

    /**
     * 登录模块 5002XX
     */
    public static CodeMsg SESSION_ERROR = new CodeMsg(500_210, "Session不存在或者已经失效");
    public static CodeMsg PASSWORD_EMPTY = new CodeMsg(500_211, "登录密码不能为空");
    public static CodeMsg MOBILE_EMPTY = new CodeMsg(500_212, "手机号不能为空");
    public static CodeMsg MOBILE_ERROR = new CodeMsg(500_213, "手机号格式错误");
    public static CodeMsg MOBILE_NOT_EXIST = new CodeMsg(500_214, "手机号不存在");
    public static CodeMsg PASSWORD_ERROR = new CodeMsg(500_215, "密码错误");
    public static CodeMsg PRIMARY_ERROR = new CodeMsg(500_216, "主键冲突");

    /**
     * 订单模块 5004XX
     */
    public static CodeMsg ORDER_NOT_EXIST = new CodeMsg(500_400, "订单不存在");

    /**
     * 秒杀模块 5005XX
     */
    public static CodeMsg SECKILL_OVER = new CodeMsg(500_500, "商品已经秒杀完毕");
    public static CodeMsg REPEAT_SECKILL = new CodeMsg(500_501, "不能重复秒杀");

}
